package com.bss.service;

import java.util.TimeZone;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.andy.basics.Dao;
import com.bss.dao.UserDao;
import com.bss.model.User;

@Service
@Scope("session")
public class UserService extends com.andy.basics.Service<User> {

	private String timeZoneID = "Asia/Kolkata";

	public String getTimeZoneID() {
		return this.timeZoneID;
	}

	public void setTimeZoneID(final String timeZoneID) {
		this.timeZoneID = timeZoneID;
	}

	private TimeZone timeZone = TimeZone.getTimeZone(this.timeZoneID);

	@Autowired
	private UserDao userDao;

	public void setUserDao(final UserDao userDao) {
		this.userDao = userDao;
	}

	public UserDao getUserDao() {
		return this.userDao;
	}

	public String getUserName() {
		return this.userDao.findById(2).getName();
	}

	public void setTimeZone(final TimeZone timeZone) {
		this.timeZone = timeZone;
	}

	public TimeZone getTimeZone() {
		return this.timeZone;
	}

	@Override
	public Dao<User> getDao() {
		return this.userDao;
	}

}
